<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
		<title>查看图片页</title>
		<script src="../../script/jquery.min.js" type="text/javascript"></script>
		<style>
			body, html {
				height: 100%;
				background-color: rgba(0,0,0,0.5);
				margin: 0;
			}
			div {
				height: 100%;
				position: relative;
			}
			img {
				position: absolute;
				left: 50%;
				top: 50%;
				-moz-transform: translate(-50%,-50%);
				-webkit-transform: translate(-50%,-50%);
				transform: translate(-50%,-50%);
			}
			.back-btn-div{
				width: 44px;
				height: 44px;
				position: fixed;
				top: 22px;
				left: 0;
				z-index: 99;
			}
			.back-btn-img{
				height: 20px;
			}
			.image-browser{
				max-width: 100%;
			}
			.image-browser-div{
				text-align: center;
			}
		</style>
	</head>
	<body>
		<div class="back-btn-div" onclick="closeThisWin()">
			<img class="back-btn-img" src="../../image/icon_jiantou.png">
		</div>
		<div class="image-browser-div">
			<img class="image-browser" id="imageBrowser" src="../../image/course_placehoder.png" alt="">
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript" src="../../script/common.js"></script>
	<script type="text/javascript">
		apiready = function() {
			setupScreenOrientation();
			setupImageBrowser();
			setupNotifi();
		}
		function setupScreenOrientation(){
			api.setScreenOrientation({orientation:"auto"});
		}
		function setupImageBrowser(){
			var pageParam = api.pageParam;
			//图片地址
			var files = '';
			if (pageParam.filepath.indexOf("http://") == 0) {
				files = pageParam.filepath;
			} else {
				files = "file://" + pageParam.filepath;
			}
			//根据图片地址，显示图片
			$('#imageBrowser').attr('src', files);
		}
		function setupNotifi(){
			api.addEventListener({
			    name: 'keyback'
			}, function(ret, err) {
			    closeThisWin();
			});
		}
		function closeThisWin() {
			api.sendEvent({
			    name: 'imageBackNotifi',
			    extra: api.pageParam
			});
			api.setScreenOrientation({orientation:"portrait_up"});
			api.closeWin();
		}
	</script>
</html>